using UnityEngine;
using System.Collections;

public class InteractToggleMusic : InteractObject
{
    private AudioSource audioSource;

    private bool isPlaying = false;

    void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }

    override public void Interact(MonoBehaviour sender)
    {
        if (Input.GetKeyDown(interactButton))
        {
            if (isPlaying)
                audioSource.Pause();
            else
                audioSource.Play();

            isPlaying = !isPlaying;
        }
    }
}
